//
//  SongListSongsDetailModel.m
//  YHYRealx
//
//  Created by yanghuiyan on 16/5/4.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "SongListSongsDetailModel.h"

@implementation SongListSongsDetailModel

- (instancetype)initWithDataSource:(NSDictionary *)dataSource {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *array = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.urlList) {
            SongListUrlListModel *urlListModel = [[SongListUrlListModel alloc] init];
            [urlListModel setValuesForKeysWithDictionary:dic];
            [array addObject:urlListModel];
        }
        self.urlList = [NSMutableArray arrayWithArray:array];
        
        NSMutableArray *array1 = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.auditionList) {
            SongListAuditionListModel *auditionListModel = [[SongListAuditionListModel alloc] init];
            [auditionListModel setValuesForKeysWithDictionary:dic];
            [array1 addObject:auditionListModel];
        }
        self.auditionList = [NSArray arrayWithArray:array1];
        
        NSMutableArray *array2 = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.singers) {
            SongListSingerModel *singerModel = [[SongListSingerModel alloc] init];
            [singerModel setValuesForKeysWithDictionary:dic];
            [array2 addObject:singerModel];
        }
        self.singers = [NSArray arrayWithArray:array2];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"rightKey"]) {
        _rightKeyModel = [[SongListRightKeyModel alloc] initWithDataSource:value];
    }
}


@end
